import request from '@/utils/request.js'
import store from '@/store/index.js'
export function authorizations (data) {
  return request({
    url: '/v1_0/authorizations',
    method: 'post',
    noToken: true,
    data
  })
}
export function smsCodes (mobile) {
  return request({
    url: '/v1_0/sms/codes/' + mobile
  })
}
export function userset () {
  return request({
    url: '/v1_0/user/profile'
  })
}
export function userProfileget () {
  return request({
    url: '/v1_0/user/profile',
    method: 'PATCH'
  })
}
export function userPhotoPathch (data) {
  return request({
    url: '/v1_0/user/photo',
    method: 'PATCH',
    data
  })
}
export function authorizationsput () {
  return request({
    url: '/v1_0/authorizations',
    method: 'put',
    noToken: true,
    headers: {
      Authorization: `Bearer ${store.state.user.refresh_token}`
    }
  })
}
